package br.edu.ufcg.ga.random;

import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class SeedRandomGeneratorTest {

	@Test
	public void testFixedSeed(){
		
		int MAX = 10;
		
		List<int[]> arrays = new ArrayList<int[]>();
		
		for (int i = 0; i < 100; i++) {
			
			SeedRandomGenerator srg = new SeedRandomGenerator(1L);
			int[] array = new int[MAX];
			for (int j = 0; j < MAX; j++) {
				array[j] = srg.nextInt(MAX);
			}
			arrays.add(array);
		}
		
		int[] base = arrays.get(0);
		for (int i = 1; i < arrays.size(); i++) {
			int[] other = arrays.get(i);
			for (int j = 0; j < base.length; j++) {
				assertTrue(base[j] == other[j]);
			}
			
		}
		
	}
	
}
